import { Component, OnInit,Input,Output,EventEmitter } from '@angular/core';
import {TranslateService} from '@ngx-translate/core';
import {TreeService} from '../../../services/tree.service'

@Component({
    selector: 'app-edit-dialog',
    templateUrl: './edit-dialog.component.html',
    styleUrls: ['./edit-dialog.component.css']
})

export class EditDialogComponent implements OnInit {

    // editdialogShow=false;
    operate={
        equal:true
    }
    keyword:string;
    loadSelect=true;
    selectItems=[]
    param={
        values:[]
    }
    index=[]


    constructor(
        private treeservice:TreeService,
        public translate:TranslateService
    ){
        translate.addLangs(['zh','en']);                          //添加语言支持
        translate.setDefaultLang('en');                           //设置默认语言
        let broswerLang = translate.getBrowserLang();              //获取浏览器支持的语言
        console.log(broswerLang)                                   //zh
        translate.use(broswerLang.match(/zh|en/) ? broswerLang : 'en');
    }

    @Input() editdialogShow:boolean=false;
    @Input() editParam:any;
    @Output() editdialogClose=new EventEmitter<any>();
    ngOnInit(){
        // console.log(this.treeservice.getdialogdata())
        // if(this.treeservice.getdialogdata()){
        //     this.editdialogShow=true
        // }
    }

    ngDoCheck(){
        
    }

    close(){
        this.editdialogShow=false
        this.editdialogClose.emit(this.editdialogShow)
    }
    ok(){
        this.editdialogShow=false
        this.editdialogClose.emit(this.editdialogShow)
    }

    pushValues(value){

    }

    deleteValues(params){}

    getSelects(){}

    params(){
        this.param.values=[]
    }
}